package com.agrm.api.client;

import com.agrm.model.common.dtos.ResponseResult;
import com.agrm.model.good.pojo.Good;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("good-service")
public interface GoodClient {


    /**
     * 根据id查询商品详情
     * @param id
     */
    @GetMapping("/api/v1/good/getDetail")
    ResponseResult<Good> getDetailById(@RequestParam("id") Integer id);



    /**
     * 根据id查询商品
     * @param id
     */
    @GetMapping("/api/v1/good/get")
    ResponseResult<Good> getById(@RequestParam("id") Integer id);


    @GetMapping("/api/v1/good/getSeckillGoodById/{id}")
    ResponseResult<Good> getSeckillGoodById(@PathVariable("id") Integer id);

    /**
     * 更新
     */
    @GetMapping("/api/v1/good/update")
    ResponseResult<Boolean> update(@RequestBody Good good);


    @PutMapping("/api/v1/good/updateQty/{goodId}/{qty}")
    ResponseResult<Boolean> updateQty(@PathVariable("goodId") Integer goodId,@PathVariable("qty")Integer qty);
}
